﻿#include "logwidget.h"
#include "ui_logwidget.h"

logWidget::logWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::logWidget)
{
    ui->setupUi(this);
}

logWidget::~logWidget()
{
    delete ui;
}

void logWidget::setLog(QString log)
{
    ui->plainTextEdit->appendPlainText(log+"\n");
}


void logWidget::showEvent(QShowEvent *event)
{
    Q_UNUSED(event);
    QTextCursor cursor = ui->plainTextEdit->textCursor();
    cursor.movePosition(QTextCursor::End);
    ui->plainTextEdit->setTextCursor(cursor);
}
